package anc.tankshooter.controls;

import org.andengine.entity.text.Text;

import anc.tankshooter.ui.ResourcesManager;

public class FlyText extends Text {

	private boolean mIsDead;
	private float mStartX,mStartY;
	public FlyText(float x,float y){
		super(x, y,ResourcesManager.getInstance().mWhiteFont18,"",5,ResourcesManager.getInstance().mVertexManager);
		mStartX=x; mStartY=y;
		mIsDead = false;
	}

	public void onUpdate() {
		float x=mX-mStartX;
		float y=mY-mStartY;
		float dis = x*x+y*y;
		if(dis>=32*32){
			mIsDead=true;
		}else {
			mY-=1f;
		}
	}

	public boolean isIsDead() {
		return mIsDead;
	}
	
	
}
